package com.fqgj.xjd.user.dao.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.xjd.user.dao.UserFeatureTagMapDao;
import com.fqgj.xjd.user.entity.UserFeatureTagMapEntity;

/**
* User: zhangxingyun
* Date: 2017-07-20
* Time: 18:38:53.096
*/

@Repository
public class UserFeatureTagMapDaoImpl extends AbstractBaseMapper<UserFeatureTagMapEntity> implements UserFeatureTagMapDao {

    @Override
    public Integer addTagsToUser(String userCode, List<Long> tags) {
        Map<String, Object> map = new HashMap<>();
        map.put("userCode", userCode);
        map.put("tags", tags);
        return getSqlSession().update(getStatement("addTagsToUser"), map);
    }

    @Override
    public List<UserFeatureTagMapEntity> getAllUserFeatureTags(String userCode){
        return getSqlSession().selectList(getStatement("getAllUserFeatureTags"), userCode);
    }
}